<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">		
		<link href="${pageContext.request.contextPath}/css/globaltd.css"
			rel="stylesheet" type="text/css">
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery-1.3.2.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
	<body>
		<div class="wrapper">
			<div class="container">
				<div class="nav" id="navText">
					试题管理
				</div>
				<form id="form1" action="${pageContext.request.contextPath}/topicIndex.action" method="post">
				<div class="tag">
					<table class="search-tab" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<th>
									编号:
								</th>
								<td>
									<input size="8" type="text" name="topicId" id="topicId" value="${param.topicId}" />
								</td>
								<th>
									试题标题:
								</th>
								<td>
									<input type="text" name="title" id="title" value="${param.title}" />
								</td>
								<th>
									试题学历:
								</th>
								<td>
									<select id="grade"  name="grade" style="width: 150px;">	
											<option value="-1" <c:if test="${param.grade==-1}" >selected="selected"</c:if>>请选择</option>									
											<option value="0" <c:if test="${param.grade==0}" >selected="selected"</c:if>>电影学院学前班</option>									
											<option value="1" <c:if test="${param.grade==1}" >selected="selected"</c:if>>电影学院一年级</option>									
											<option value="2" <c:if test="${param.grade==2}" >selected="selected"</c:if>>电影学院二年级</option>									
											<option value="3" <c:if test="${param.grade==3}" >selected="selected"</c:if>>电影学院三年级</option>									
											<option value="4" <c:if test="${param.grade==4}" >selected="selected"</c:if>>电影学院四年级</option>									
											<option value="5" <c:if test="${param.grade==5}" >selected="selected"</c:if>>电影学院五年级</option>									
											<option value="6" <c:if test="${param.grade==6}" >selected="selected"</c:if>>电影学院六年级</option>									
											<option value="7" <c:if test="${param.grade==7}" >selected="selected"</c:if>>电影学院七年级</option>									
											<option value="8" <c:if test="${param.grade==8}" >selected="selected"</c:if>>电影学院八年级</option>									
											<option value="9" <c:if test="${param.grade==9}" >selected="selected"</c:if>>电影学院九年级</option>									
											<option value="10" <c:if test="${param.grade==10}" >selected="selected"</c:if>>电影学院十年级</option>									
											<option value="11" <c:if test="${param.grade==11}" >selected="selected"</c:if>>电影学院十一年级</option>									
											<option value="12" <c:if test="${param.grade==12}" >selected="selected"</c:if>>电影学院十二年级</option>									
											<option value="13" <c:if test="${param.grade==13}" >selected="selected"</c:if>>电影学院大学一年级</option>									
											<option value="14" <c:if test="${param.grade==14}" >selected="selected"</c:if>>电影学院大学二年级</option>									
											<option value="15" <c:if test="${param.grade==15}" >selected="selected"</c:if>>电影学院大学三年级</option>									
											<option value="16" <c:if test="${param.grade==16}" >selected="selected"</c:if>>电影学院大学四年级</option>									
											<option value="17" <c:if test="${param.grade==17}" >selected="selected"</c:if>>电影学院大学五年级</option>									
											<option value="18" <c:if test="${param.grade==18}" >selected="selected"</c:if>>电影学院大学六年级</option>									
											<option value="19" <c:if test="${param.grade==19}" >selected="selected"</c:if>>电影学院研究生一年级</option>									
											<option value="20" <c:if test="${param.grade==20}" >selected="selected"</c:if>>电影学院研究生二年级</option>									
											<option value="21" <c:if test="${param.grade==21}" >selected="selected"</c:if>>电影学院研究生三年级</option>									
											<option value="22" <c:if test="${param.grade==22}" >selected="selected"</c:if>>电影学院博士一年级</option>									
											<option value="23" <c:if test="${param.grade==23}" >selected="selected"</c:if>>电影学院博士二年级</option>									
											<option value="24" <c:if test="${param.grade==24}" >selected="selected"</c:if>>电影学院博士三年级</option>									
											<option value="25" <c:if test="${param.grade==25}" >selected="selected"</c:if>>电影学院教授一年级</option>									
											<option value="26" <c:if test="${param.grade==26}" >selected="selected"</c:if>>电影学院教授二年级</option>									
											<option value="27" <c:if test="${param.grade==27}" >selected="selected"</c:if>>电影学院教授三年级</option>									
												
											<option value="90" <c:if test="${param.grade==90}" >selected="selected"</c:if>>电影学院小学毕业</option>
											<option value="91" <c:if test="${param.grade==91}" >selected="selected"</c:if>>电影学院中学毕业</option>
											<option value="92" <c:if test="${param.grade==92}" >selected="selected"</c:if>>电影学院大学毕业</option>
											<option value="93" <c:if test="${param.grade==93}" >selected="selected"</c:if>>电影学院硕士毕业</option>
											<option value="94" <c:if test="${param.grade==94}" >selected="selected"</c:if>>电影学院博士毕业</option>
											<option value="95" <c:if test="${param.grade==95}" >selected="selected"</c:if>>电影学院教授毕业</option>
													<!--  <option value="6">电影学院六年级</option>-->
												</select>	
								</td>
								<th>
									试题备注:
								</th>
								<td>
									<input type="text" name="remark" id="remark" value="${param.remark}" />
								</td>
								<td>
									<select id="ablumId" name="ablumId">
										<option value="0" <c:if test="${param.ablumId==0}">selected="selected"</c:if>>请选择</option>
										<c:forEach items="${ablumList}" var="ablum">
											<option value="${ablum.id}" <c:if test="${param.ablumId==ablum.id}">selected="selected"</c:if>>${ablum.title}</option>
										</c:forEach>
									</select>
								</td>
								<td>
									<input class="btn" value="查询" id="queryBtn" type="submit">
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				</form>
				
				<div id="tablePanel">
					<table cellspacing="0" cellpadding="0" even="true" class="list">
						<tbody>
							<tr class="even" style="line-height: 30px;">
								<th class="fi" >编号</th>
								<th class="fi" width="10%">试题标题</th>
								<!--  <th class="fi">试题资源</th>-->
								<th class="fi">试题类型 </th>
								<th class="fi">所属专辑</th>
								<th class="fi">试题学历</th>
								<th class="fi">学历类型</th>
								<th class="fi" width="10%">试题备注</th>
								<th class="fi">保存时间</th>
								<th class="fi">操作</th>
							</tr>
							<c:forEach items="${dataList}" var="topic" varStatus="stat">
								<c:choose>
									<c:when test="${stat.index%2==0}"><tr></c:when>
									<c:otherwise><tr class="even"></c:otherwise>
								</c:choose>	
									<td height="40">${topic.id}</td>								
									<td >${topic.title}</td>								
									<!--  <td>${topic.resourceUrl}&nbsp;</td>-->
									<td>
										<c:choose>
											<c:when test="${topic.type==1}">文本</c:when>
											<c:when test="${topic.type==2}">图片</c:when>
											<c:when test="${topic.type==4}">视频</c:when>
											<c:when test="${topic.type==3}">音频</c:when>
											<c:otherwise>未知</c:otherwise>
										</c:choose>
									</td>																
									<td>${topic.ablum.title}</td>							
									<td>
										<c:if test="${topic.gradeType==1}"><!-- 学院类学历id -->
											<c:choose>
												<c:when test="${topic.gradeId==0}">电影学院学前班</c:when>									
												<c:when test="${topic.gradeId==1}">电影学院一年级</c:when>									
												<c:when test="${topic.gradeId==2}">电影学院二年级</c:when>									
												<c:when test="${topic.gradeId==3}">电影学院三年级</c:when>									
												<c:when test="${topic.gradeId==4}">电影学院四年级</c:when>									
												<c:when test="${topic.gradeId==5}">电影学院五年级</c:when>									
												<c:when test="${topic.gradeId==6}">电影学院六年级</c:when>									
												<c:when test="${topic.gradeId==7}">电影学院七年级</c:when>									
												<c:when test="${topic.gradeId==8}">电影学院八年级</c:when>									
												<c:when test="${topic.gradeId==9}">电影学院九年级</c:when>									
												<c:when test="${topic.gradeId==10}">电影学院十年级</c:when>									
												<c:when test="${topic.gradeId==11}">电影学院十一年级</c:when>									
												<c:when test="${topic.gradeId==12}">电影学院十二年级</c:when>									
												<c:when test="${topic.gradeId==13}">电影学院大学一年级</c:when>									
												<c:when test="${topic.gradeId==14}">电影学院大学二年级</c:when>									
												<c:when test="${topic.gradeId==15}">电影学院大学三年级</c:when>									
												<c:when test="${topic.gradeId==16}">电影学院大学四年级</c:when>									
												<c:when test="${topic.gradeId==17}">电影学院大学五年级</c:when>									
												<c:when test="${topic.gradeId==18}">电影学院大学六年级</c:when>									
												<c:when test="${topic.gradeId==19}">电影学院研究生一年级</c:when>									
												<c:when test="${topic.gradeId==20}">电影学院研究生二年级</c:when>									
												<c:when test="${topic.gradeId==21}">电影学院研究生三年级</c:when>									
												<c:when test="${topic.gradeId==22}">电影学院博士一年级</c:when>									
												<c:when test="${topic.gradeId==23}">电影学院博士二年级</c:when>									
												<c:when test="${topic.gradeId==24}">电影学院博士三年级</c:when>									
												<c:when test="${topic.gradeId==25}">电影学院教授一年级</c:when>									
												<c:when test="${topic.gradeId==26}">电影学院教授二年级</c:when>									
												<c:when test="${topic.gradeId==27}">电影学院教授三年级</c:when>									
												<c:when test="${topic.gradeId==28}">电影学院院士</c:when>	
												<c:otherwise>未知</c:otherwise>
											</c:choose>												
										</c:if>
										<c:if test="${topic.gradeType!=1}"><!-- 明星类和电影类学历id -->
											<c:choose>
												<c:when test="${topic.gradeId==0}">电影学院小学毕业</c:when>
												<c:when test="${topic.gradeId==1}">电影学院中学毕业</c:when>
												<c:when test="${topic.gradeId==2}">电影学院大学毕业</c:when>
												<c:when test="${topic.gradeId==3}">电影学院硕士毕业</c:when>
												<c:when test="${topic.gradeId==4}">电影学院博士毕业</c:when>
												<c:when test="${topic.gradeId==5}">电影学院教授毕业</c:when>
												<c:when test="${topic.gradeId==6}">电影学院六年级</c:when>	
												<c:otherwise>未知</c:otherwise>			
											</c:choose>										
										</c:if>							
									</td>								
									<td>${topic.gradeType}
									<c:choose>
										<c:when test="${topic.gradeType==1}">学院类</c:when>
										<c:when test="${topic.gradeType==2}">电影类，明星类</c:when>
										<c:when test="${topic.gradeType==3}">电影类，明星类</c:when>
										<c:otherwise>未知</c:otherwise>
									</c:choose>
									&nbsp;</td>								
									<td>${topic.remark}&nbsp;</td>								
									<td>${topic.saveTime}&nbsp;</td>								
									<td>
									<a href="${pageContext.request.contextPath}/removeTopic.action?id=${topic.id}">删除</a>
									&nbsp;
									<a href="${pageContext.request.contextPath}/toAddOption.action?topicId=${topic.id}">选项管理</a>
									</td>								
								</tr>							
							</c:forEach>								
						</tbody>
					</table>
			<div class="pagin">
				<c:if test="${count > 0 }">每页显示<c:out value="${pageSize }" />条　共<c:out value="${count}" />条 </c:if>
				<c:if test="${pageCount > 1 && pageCount < 12}">
					<c:forEach begin="1" end="${pageCount}" step="1" var="i" >
						<c:choose>
							<c:when test="${pageNum==i}">
									<a style="color:#c30f07" href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>&order=${orderField } ${order }">[<c:out value="${i}" />]</a>
							</c:when>
							<c:otherwise>
										<a href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>&order=${orderField } ${order }">[<c:out value="${i}" />]</a>
							</c:otherwise>
						</c:choose>						
					</c:forEach>
				</c:if>
				<c:if test="${pageCount >= 12}">
					<c:if test="${pageNum < 7}">
						<c:forEach begin="1" end="10" step="1" var="i" >							
							<c:choose>
								<c:when test="${pageNum==i}">
									<a style="color:#c30f07" href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>">[<c:out value="${i}" />]</a>
								</c:when>
								<c:otherwise>
									<a href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>">[<c:out value="${i}" />]</a>
								</c:otherwise>
							</c:choose>							
						</c:forEach>
						... 
						<c:url var="lastPageUrl" value="${pageContext.request.contextPath}/topicIndex.action?"><c:forEach items="${params}" var="item" varStatus="st"><c:param name="${item.key}" value="${item.value}" /></c:forEach><c:param name="page" value="${pageCount}" /></c:url>
						<a href="${lastPageUrl}">[${pageCount}]</a>
					</c:if>
					<c:if test="${pageNum >= 7}">
						<a href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=1">[1]</a>
						...
						<c:forEach begin="${(pageCount - pageNum) < 7 ? (pageCount - 7) : (pageNum - 2)}" end="${(pageNum + 4) < pageCount ? (pageNum + 4) : (pageCount - 1)}" step="1" var="i" >
							<c:choose>
								<c:when test="${pageNum==i}">
									<a style="color:#c30f07" href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>">[<c:out value="${i}" />]</a>
								</c:when>
								<c:otherwise>
									<a href="${pageContext.request.contextPath}/topicIndex.action?<c:forEach items="${params}" var="item" varStatus="st"><c:out value="${ item.key }"/>=<c:out value="${item.value}" />&</c:forEach>page=<c:out value="${ i }"/>">[<c:out value="${i}" />]</a>
								</c:otherwise>
							</c:choose>	
						</c:forEach>
						
						<c:if test="${pageCount - (pageNum + 4) > 1}"> ... </c:if>
						
						<c:url var="lastPageUrl" value="${pageContext.request.contextPath}/topicIndex.action?">
						<c:forEach items="${params}" var="item" varStatus="st"><c:param name="${item.key}" value="${item.value}" /></c:forEach>
						<c:param name="page" value="${pageCount}" />
						</c:url>						
						<c:choose>
							<c:when test="${pageNum==pageCount}">
								<a style="color:#c30f07" href="${lastPageUrl}">[${pageCount}]</a>							
							</c:when>
							<c:otherwise>
								<a href="${lastPageUrl}">[${pageCount}]</a>							
							</c:otherwise>
						</c:choose>		
					</c:if>
				</c:if>
			</div>					
					
					
				</div>
			</div>
		</div>
	</body>
</html>